﻿/******************************************************************************
copyright(c)cguage.com
source code can be free to use and publish, but please keep header comments, thx

author:  cguage
contact: tangcraig@gmail.com
desc:    missing
date:    unknown

*******************************************************************************/
#pragma once

#include "Tool.h"
#include <iostream>
#include <sstream>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <cassert>
#include <ctime>
#include <Windows.h>
#include "InfoWnd.h"
#include "resource.h"
#include "SleepableCoroutine.h"
using namespace std;
using namespace CggUtil;

#include "Job.inl"
#pragma warning(disable:4996)
#pragma comment(linker, "/subsystem:\"CONSOLE\" /entry:\"WinMainCRTStartup\"")

#define LOG(args) log((ostringstream&)                               \
        (ostringstream() << "[" << getCurrentTime() << "] "          \
        << args), LOW)

class TheTool : public Tool {
protected:
    virtual void start(HINSTANCE inst, const char* cmdLine) {
        srand((unsigned int)time(NULL));

        if (!InfoWnd::create(inst)) {
            ::MessageBox(NULL, "create wnd failed", NULL, MB_OK);
            return;
        }
        Job::doJobs();
    }
} _;

#include "AutoShutdown.inl"
#include "LimitAppTime.inl"
#include "ResetAppTime.inl"
#include "UserControl.inl"
#include "CheckConfig.inl"
#include "WriteLog.inl"